﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity;
using Northwind.Model;
using System.Diagnostics;

namespace Northwind.Repositories.Entity
{
    public class TerritoriesRepository : ITerritoriesRepository
    {
        #region Fields
        private NorthwindContext _context = new NorthwindContext();
        #endregion

        #region ITerritoriesRepository Members
        public IEnumerable<Territory> FindStartingWith(string term)
        {
            return from territory in _context.Territories
                   where territory.Description.StartsWith(term)
                   select territory;
        }
        #endregion
    }
}
